///home/lt/桌面/gatway_lt/test/process_test/other
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
int main(int argc, char const *argv[])
{
    printf("main(父)进程(%d)开始执行\n", getpid());
    pid_t pid = fork();
    if (pid == 0)//子进程
    {
        printf("子进程(%d)开始执行\n", getpid());
        char *path = "/home/lt/桌面/gatway_lt/test/process_test/other";
        char *argv[] = {path, "app", NULL};
        char *envp[] = {NULL};//使用默认值环境变量
        execve(path, argv,NULL);
        printf("子进程(%d)执行失败\n", getpid());
        return -1;
    }
    else{
        printf("父进程(%d)继续执行\n", getpid());
    }
    printf("进程（%d）执行结束\n", getpid());
    
    return 0;
}
